/**
 * @description 冒泡排序算法
 */
Array.prototype.bubbleSort = function (){
    for (let i = 0; i < this.length - 1; i++) {
        for(let j = 0; j < this.length - 1 - i; j += 1){
            if (this[j] > this[j+1]){
                const tmp = this [j];
                this[j] = this[j+1];
                this[j+1] = tmp;
            }
        }
    }
};

//时间复杂度：O(n^2)